Communication Method and Communications Apparatus

ABSTRACT

A method in which a terminal device moves from a first AN node to a second AN node, where the method includes: receiving identification information of a to-be-activated session from the terminal device via the second AN node; sending a context release command to the first AN node when a signaling connection of the terminal device exits between an AMF node and the first AN node; receiving a context release complete message carrying identification information of an active session of the terminal device from the first AN node; when the to-be-activated session and the active session have a same session, sending a first request message to request to deactivate the same session to an SMF node corresponding to the same session; and after the same session is deactivated, sending, to the SMF node, a second request message to request to activate the same session.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.16/878,543, filed on May 19, 2020, which is a continuation ofInternational Patent Application No. PCT/CN2018/116695, filed on Nov.21, 2018, which claims priority to Chinese Patent Application No.201711166063.4, filed on Nov. 21, 2017. All of the aforementioned patentapplications are hereby incorporated by reference in their entireties.

TECHNICAL FIELD

This application relates to the field of communications technologies,and in particular, to a communication method and a communicationsapparatus.

BACKGROUND

With upgrade of mobile communications technologies, many innovativeapplications are certainly brought for various industries, and mobilebroadband, multimedia, machine type communication (MTC), industrialcontrol, and an intelligent transportation system (ITS) are to becomemain use cases in a 5^(th) generation (5G) communications system.

In the 5G communications system, a session is used to carry servicedata. When no available session exists, a terminal device needs toinitiate a session establishment procedure, to establish a propersession to carry service data. When an available session exists but thesession is in a deactivated state, a terminal device initiates a sessionactivation procedure to activate the session. When an available sessionexists and the session is in an active state, a terminal device maydirectly transfer service data using the session. If the session has noservice data to be transferred, the session may be deactivated.Certainly, there may alternatively be a case in which a session isdeactivated due to another factor. For example, a wireless connectionbetween an access network node and the terminal device is lost.

It may be learned that whether session activation succeeds directlyaffects whether a service can be normally transmitted. To meet a widelychanging service requirement, a success rate of the session activationneeds to be further improved.

SUMMARY

Embodiments of this application provide a communication method and acommunications apparatus, to improve a success rate of sessionactivation.

According to a first aspect, a communication method is provided. Themethod is applied to a scenario in which a terminal device moves from afirst access network (AN) node to a second AN node. The method includes:receiving, by an access control and mobility management function (AMF)node, identification information of a to-be-activated session from theterminal device using the second AN node; sending, by the AMF node, acontext release command to the first AN node when a signaling connectionof the terminal device exits between the AMF node and the first AN node,where the context release command is used to instruct to release acontext of the terminal device; receiving, by the AMF node, a contextrelease complete message from the first AN node, where the contextrelease complete message carries identification information of an activesession of the terminal device; when the to-be-activated session and theactive session have a same session, sending, by the AMF node, a firstrequest message to a session management function (SMF) nodecorresponding to the same session, where the first request message isused to request to deactivate the same session; and sending, by the AMFnode, a second request message to the SMF node after the same session isdeactivated, where the second request message is used to request toactivate the same session. In the method, after receiving theidentification information of the to-be-activated session from theterminal device using the second AN node, the AMF node does notimmediately send, to an SMF node, a message used to request to activatethe session. Instead, the AMF node releases the signaling connectionwhen the signaling connection of the terminal device exists between theAMF node and the first AN node. For example, the AMF node sends thecontext release command to the first AN node, and receives theidentification information of the active session of the terminal device.When the active session and the to-be-activated session have the samesession, the AMF node first requests to deactivate the same session andthen requests to activate the same session. In this way, an activationfailure problem caused in other approaches because it is requested todeactivate a session just after it is requested to activate the sessionis resolved, thereby improving a success rate of session activation andimproving user experience.

According to a second aspect, a communication method is provided. Themethod is applied to a scenario in which a terminal device moves from afirst AN node to a second AN node. The method includes: receiving, by anAMF node, identification information of a to-be-activated session fromthe terminal device using the second AN node; sending, by the AMF node,a context release command to the first AN node when a signalingconnection of the terminal device exits between the AMF node and thefirst AN node, where the context release command is used to instruct torelease a context of the terminal device; receiving, by the AMF node, acontext release complete message from the first AN node, where thecontext release complete message carries identification information ofan active session of the terminal device; and when the to-be-activesession and the active session have a same session, sending, by the AMFnode, a first request message to an SMF node corresponding to the samesession, where the first request message is used to request to activatethe same session, or the first request message is used to request tofirst deactivate the same session and then reactivate the same session.In the method, after receiving the identification information of theto-be-activated session from the terminal device using the second ANnode, the AMF node does not immediately send, to an SMF node, a messageused to request to activate the session. Instead, the AMF node releasesthe signaling connection when the signaling connection of the terminaldevice exists between the AMF node and the first AN node. For example,the AMF node sends the context release command to the first AN node, andreceives the identification information of the active session of theterminal device. When the active session and the to-be-activated sessionhave the same session, the AMF node first requests to deactivate thesame session and then requests to activate the same session, or the AMFnode requests to activate the same session. In this way, an activationfailure problem caused in other approaches because it is requested todeactivate a session just after it is requested to activate the sessionis resolved, thereby improving a success rate of session activation andimproving user experience.

With reference to the second aspect, in a first implementation of thesecond aspect, the method further includes: when the to-be-activatedsession and the active session have a different session, sending, by theAMF node, a second request message to an SMF node corresponding to asession that is in the to-be-activated session but not in the activesession, and sending a third request message to an SMF nodecorresponding to a session that is in the active session but not in theto-be-activated session.

The second request message is used to request to activate the sessionthat is in the to-be-activated session but not in the active session,and the third request message is used to request to deactivate thesession that is in the active session but not in the to-be-activatedsession. According to the method, activation or deactivation isimplemented on the different session.

With reference to the second aspect, in a second implementation of thesecond aspect, when the first request message is used to request toactivate the same session, the first request message carries deletionindication information, and the deletion indication information is usedto indicate to delete (radio) access network (R)AN tunnel information ofthe same session. In other words, before the same session is activated,the (R)AN tunnel information of the session is deleted. In this way, adata transmission failure caused because a user plane function (UPF)node sends data of the terminal device to the first AN node based on theinformation is avoided.

According to a third aspect, a communication method is provided. Themethod is applied to a scenario in which a terminal device moves from afirst AN node to a second AN node. The method includes: receiving, by anAMF node using the second AN node, identification information of ato-be-activated session from the terminal device; sending, by the AMFnode, a first request message to an SMF node based on the identificationinformation of the to-be-activated session, where the first requestmessage is used to request to activate the to-be-activated session;sending, by the AMF node, a context release command to the first AN nodewhen a signaling connection of the terminal device exists between theAMF node and the first AN node, where the context release command isused to instruct to release a context of the terminal device; receiving,by the AMF node, a context release complete message from the first ANnode, where the context release complete message carries identificationinformation of an active session of the terminal device; and when theto-be-activated session and the active session have a same session,skipping, by the AMF node, sending a second request message to an SMFnode corresponding to the same session, where the second request messageis used to request to deactivate the same session. In the method, afterreceiving the identification information of the to-be-activated sessionfrom the terminal device using the second AN node, the AMF nodeimmediately requests the SMF node to activate the session. The AMF nodereleases the signaling connection when the signaling connection of theterminal device exists between the AMF node and the first AN node. Forexample, the AMF node sends the context release command to the first ANnode, and receives the identification information of the active sessionof the terminal device. When the active session and the to-be-activatedsession have the same session, the AMF node no longer requests todeactivate the same session. In this way, an activation failure problemcaused in other approaches because it is requested to deactivate asession just after it is requested to activate the session is resolved,thereby improving a success rate of session activation and improvinguser experience.

According to a fourth aspect, a communication method is provided. Themethod is applied to a scenario in which a terminal device moves from afirst AN node to a second AN node. The first AN node is managed by afirst AMF node, and the second AN node is managed by a second AMF node.The method includes: receiving, by the first AMF node, a first requestmessage from the second AMF node, where the first request message isused to request a mobility management (MM) context of the terminaldevice; sending, by the first AMF node, a context release command to thefirst AN node when a signaling connection of the terminal device existsbetween the first AMF node and the first AN node, where the contextrelease command is used to instruct to release a context of the terminaldevice; receiving, by the first AMF node, a context release completemessage from the first AN node, where the context release completemessage carries identification information of an active session of theterminal device; sending, by the first AMF node, a second requestmessage to an SMF node corresponding to the active session, where thesecond request message is used to request to deactivate the activesession; and sending, by the first AMF node, a first response message tothe second AMF node after the active session is deactivated, where thefirst response message carries the MM context of the terminal device. Inthe method, the first AMF node receives, from the second AMF node, amessage used to request the context of the terminal device. The firstAMF node releases the signaling connection when the signaling connectionof the terminal device exists between the first AMF node and the firstAN node. For example, after sending the context release command to thefirst AN node and receiving the identification information of the activesession of the terminal device, the first AMF node requests the SMF nodeto deactivate the active session, and sends the context of the terminaldevice to the second AMF node after the deactivation succeeds, such thatthe corresponding session has been successfully deactivated when thesecond AMF node receives the context of the terminal device and thenrequests to activate the session. In this way, an activation failureproblem caused in other approaches because it is requested to deactivatea session just after it is requested to activate the session isresolved, thereby improving a success rate of session activation andimproving user experience.

According to a fifth aspect, a communication method is provided. Themethod is applied to a scenario in which a terminal device moves from afirst AN node to a second AN node. The first AN node is managed by afirst AMF node, and the second AN node is managed by a second AMF node.The method includes: receiving, by the first AMF node, a first requestmessage from the second AMF node, where the first request message isused to request a mobility management context of the terminal device,and where the first request message carries identification informationof a to-be-activated session of the terminal device; sending, by thefirst AMF node, a context release command to the first AN node when asignaling connection of the terminal device exists between the first AMFnode and the first AN node, where the context release command is used toinstruct to release a context of the terminal device; receiving, by thefirst AMF node, a context release complete message from the first ANnode, where the context release complete message carries identificationinformation of an active session of the terminal device; and sending, bythe first AMF node, a first response message to the second AMF node,where the first response message carries the mobility management contextof the terminal device. In the method, the first AMF node receives, fromthe second AMF node, a message used to request the context of theterminal device. The message carries the identification information ofthe to-be-activated session. The first AMF node releases the signalingconnection when the signaling connection of the terminal device existsbetween the first AMF node and the first AN node. For example, the firstAMF node sends the context release command to the first AN node, andsends the context of the terminal device to the second AMF node afterreceiving the context release complete message. In this way, the secondAMF node does not request an SMF node to activate a to-be-activatedsession just after the second AMF node receives an identifier of thesession, thereby improving a success rate of session activation andimproving user experience. In addition, based on the identificationinformation of the to-be-activated session, the first AMF node does notrequest the SMF node to deactivate the to-be-activated session. In thisway, an activation failure problem caused in other approaches because itis requested to deactivate a session just after it is requested toactivate the session is resolved.

With reference to the fifth aspect, in a first implementation of thefifth aspect, when the to-be-activated session and the active sessionhave a same session, the first response message further carriesidentification information of the same session; or when theto-be-activated session and the active session do not have a samesession, the first response message further carries indicationinformation, and the indication information is used to indicate that theto-be-activated session and the active session do not have the samesession, where the identification information of the same session may beused by the second AMF node to request the SMF node to perform specialprocessing, for example, delete (R)AN tunnel information correspondingto the same session.

With reference to the fifth aspect, in a second implementation of thefifth aspect, the first response message further carries theidentification information of the active session. The identificationinformation of the active session may be used by the second AMF node todetermine whether the active session and the to-be-activated sessionhave the same session, and the second AMF node may further request theSMF node to perform special processing, for example, delete (R)AN tunnelinformation corresponding to the same session.

With reference to the fifth aspect or either of the foregoingimplementations of the fifth aspect, in a third implementation of thefifth aspect, the method further includes: when the to-be-activatedsession and the active session have a different session, sending, by thefirst AMF node, a second request message to an SMF node corresponding toa session that is in the active session but not in the to-be-activatedsession, where the second request message is used to request todeactivate the session that is in the active session but not in theto-be-activated session. In this way, the deactivation on the differentsession is implemented.

According to a sixth aspect, a communication method is provided. Themethod is applied to a scenario in which a terminal device moves from afirst AN node to a second AN node. The first AN node is managed by afirst AMF node, and the second AN node is managed by a second AMF node.The method includes: sending, by the second AMF node, a first requestmessage to the first AMF node, where the first request message is usedto request a mobility management context of the terminal device, and thefirst request message carries identification information of ato-be-activated session of the terminal device; and receiving, by thesecond AMF node, a first response message from the first AMF node, wherethe first response message carries the mobility management context ofthe terminal device. Based on the identification information of theto-be-activated session, the first AMF node does not request an SMF nodeto deactivate the to-be-activated session. In this way, an activationfailure problem caused in other approaches because it is requested todeactivate a session just after it is requested to activate the sessionis resolved.

With reference to the sixth aspect, in a first implementation of thesixth aspect, the first response message further carries identificationinformation of an active session of the terminal device, and the methodfurther includes: when the to-be-activated session and the activesession have a same session, sending, by the second AMF node, a secondrequest message to an SMF node corresponding to the same session.

The second request message is used to request to activate the samesession; or the second request message is used to request to activatethe same session, the second request message carries deletion indicationinformation, and the deletion indication information is used to indicateto delete (radio) access network (R)AN tunnel information of the samesession; or the second request message is used to request to firstdeactivate the same session and then reactivate the same session.

With reference to the sixth aspect, in a second implementation of thesixth aspect, the first response message further carries identificationinformation of a same session, the same session is a session between theto-be-activated session and an active session of the terminal device,and the method further includes: sending, by the second AMF node, asecond request message to an SMF node corresponding to the same session.

The second request message is used to request to activate the samesession; or the second request message is used to request to activatethe same session, the second request message carries deletion indicationinformation, and the deletion indication information is used to indicateto delete (R)AN tunnel information of the same session; or the secondrequest message is used to request to first deactivate the same sessionand then reactivate the same session.

According to a seventh aspect, a communication method is provided. Themethod is applied to a scenario in which a terminal device moves from afirst AN node to a second AN node. The first AN node is managed by afirst AMF node, and the second AN node is managed by a second AMF node.The method includes: receiving, by the first AMF node, a first requestmessage from the second AMF node, where the first request message isused to request a mobility management context of the terminal device,and the first request message carries identification information of ato-be-activated session of the terminal device; sending, by the firstAMF node, a first response message to the second AMF node, where thefirst response message carries the mobility management context of theterminal device; sending, by the first AMF node, a context releasecommand to the first AN node when a signaling connection of the terminaldevice exists between the first AMF node and the first AN node, wherethe context release command is used to instruct to release a context ofthe terminal device; receiving, by the first AMF node, a context releasecomplete message from the first AN node, where the context releasecomplete message carries identification information of an active sessionof the terminal device; and when the to-be-activated session and theactive session have a same session, skipping, by the first AMF node,sending a second request message to an SMF node corresponding to thesame session, where the second request message is used to request todeactivate the same session. In the method, after receiving the firstrequest message from the second AMF node, the first AMF node immediatelyreplies with the response message corresponding to the first requestmessage. In this way, the second AMF node requests to activate thesession after receiving the response message, and after receiving theidentification information of the active session, the first AMF nodedetermines whether the active session and the to-be-activated sessionhave the same session. The first AMF node does not request the SMF nodeto deactivate the same session. In this way, an activation failureproblem caused in other approaches because it is requested to deactivatea session just after it is requested to activate the session isresolved, thereby improving a success rate of session activation.

With reference to the seventh aspect, in a first implementation of theseventh aspect, the method further includes: when the to-be-activatedsession and the active session have a different session, sending, by thefirst AMF node, a third request message to an SMF node corresponding toa session that is in the active session but not in the to-be-activatedsession, where the third request message is used to request todeactivate the session that is in the active session but not in theto-be-activated session.

According to an eighth aspect, a communication method is provided. Themethod includes: receiving, by an SMF node, a request message from anAMF node, where the request message is used to request to activate asession, the request message carries deletion indication information,and the deletion indication information is used to indicate to delete(radio) access network (R)AN tunnel information of the session;deleting, by the SMF node, the (R)AN tunnel information of the sessionaccording to the deletion indication information; sending, by the SMFnode, a response message to the AMF node, where the response messagecarries core network tunnel information of the session. In the method,the (R)AN tunnel information is deleted. In this way, a datatransmission failure caused because a UPF node sends data of a terminaldevice to a first AN node based on the information is avoided.

According to a ninth aspect, a communication method is provided. Themethod includes: receiving, by an SMF node, a request message from anAMF node, where the request message is used to request to firstdeactivate a session and then reactivate the session; deleting, by theSMF node, (radio) access network (R)AN tunnel information of the sessionbased on the request message; and sending, by the SMF node, a responsemessage to the AMF node, where the response message carries core networktunnel information of the session. In the method, the (R)AN tunnelinformation is deleted. In this way, a data transmission failure causedbecause a UPF node sends data of a terminal device to a first AN nodebased on the information is avoided.

According to a tenth aspect, a communication method is provided. Themethod includes: receiving, by an SMF node, a request message from anAMF node, where the request message is used to request to activate asession; and deleting, by the SMF node, (R)AN tunnel information of thesession when the session is in an active state. In the method, the (R)ANtunnel information is deleted. In this way, a data transmission failurecaused because a UPF node sends data of a terminal device to a first ANnode based on the information is avoided.

According to an eleventh aspect, a communications apparatus is provided,including a unit or a means configured to perform the steps in themethod in the first aspect. The communications apparatus may be an AMFnode, or may be at least one processing element or chip.

According to a twelfth aspect, a communications apparatus is provided,including a unit or a means configured to perform the steps in themethod in the second aspect or any implementation of the second aspect.The communications apparatus may be an AMF node, or may be at least oneprocessing element or chip.

According to a thirteenth aspect, a communications apparatus isprovided, including a unit or a means configured to perform the steps inthe method in the third aspect or any implementation of the thirdaspect. The communications apparatus may be an AMF node, or may be atleast one processing element or chip.

According to a fourteenth aspect, a communications apparatus isprovided, including a unit or a means configured to perform the steps inthe method in the fourth aspect or any implementation of the fourthaspect. The communications apparatus may be an AMF node, or may be atleast one processing element or chip.

According to a fifteenth aspect, a communications apparatus is provided,including a unit or a means configured to perform the steps in themethod in the fifth aspect or any implementation of the fifth aspect.The communications apparatus may be an AMF node, or may be at least oneprocessing element or chip.

According to a sixteenth aspect, a communications apparatus is provided,including a unit or a means configured to perform the steps in themethod in the sixth aspect or any implementation of the sixth aspect.The communications apparatus may be an AMF node, or may be at least oneprocessing element or chip.

According to a seventeenth aspect, a communications apparatus isprovided, including a unit or a means configured to perform the steps inthe method in the seventh aspect or any implementation of the seventhaspect. The communications apparatus may be an AMF node, or may be atleast one processing element or chip.

According to an eighteenth aspect, a communications apparatus isprovided, including a unit or a means configured to perform the steps inthe method in the eighth aspect or any implementation of the eighthaspect. The communications apparatus may be an SMF node, or may be atleast one processing element or chip.

According to a nineteenth aspect, a communications apparatus isprovided, including a unit or a means configured to perform the steps inthe method in the ninth aspect or any implementation of the ninthaspect. The communications apparatus may be an SMF node, or may be atleast one processing element or chip.

According to a twentieth aspect, a communications apparatus is provided,including a unit or a means configured to perform the steps in themethod in the tenth aspect or any implementation of the tenth aspect.The communications apparatus may be an SMF node, or may be at least oneprocessing element or chip.

According to a twenty-first aspect, a communications apparatus isprovided, including a processor and a memory. The memory is configuredto store a program, and the processor invokes the program stored in thememory, to perform the method in the first aspect or any implementationof the first aspect. The communications apparatus may be an AMF node, ormay be at least one processing element or chip.

According to a twenty-second aspect, a communications apparatus isprovided, including a processor and a memory. The memory is configuredto store a program, and the processor invokes the program stored in thememory, to perform the method in the second aspect or any implementationof the second aspect. The communications apparatus may be an AMF node,or may be at least one processing element or chip.

According to a twenty-third aspect, a communications apparatus isprovided, including a processor and a memory. The memory is configuredto store a program, and the processor invokes the program stored in thememory, to perform the method in the third aspect or any implementationof the third aspect. The communications apparatus may be an AMF node, ormay be at least one processing element or chip.

According to a twenty-fourth aspect, a communications apparatus isprovided, including a processor and a memory. The memory is configuredto store a program, and the processor invokes the program stored in thememory, to perform the method in the fourth aspect or any implementationof the fourth aspect. The communications apparatus may be an AMF node,or may be at least one processing element or chip.

According to a twenty-fifth aspect, a communications apparatus isprovided, including a processor and a memory. The memory is configuredto store a program, and the processor invokes the program stored in thememory, to perform the method in the fifth aspect or any implementationof the fifth aspect. The communications apparatus may be an AMF node, ormay be at least one processing element or chip.

According to a twenty-sixth aspect, a communications apparatus isprovided, including a processor and a memory. The memory is configuredto store a program, and the processor invokes the program stored in thememory, to perform the method in the sixth aspect or any implementationof the sixth aspect. The communications apparatus may be an AMF node, ormay be at least one processing element or chip.

According to a twenty-seventh aspect, a communications apparatus isprovided, including a processor and a memory. The memory is configuredto store a program, and the processor invokes the program stored in thememory, to perform the method in the seventh aspect or anyimplementation of the seventh aspect. The communications apparatus maybe an AMF node, or may be at least one processing element or chip.

According to a twenty-eighth aspect, a communications apparatus isprovided, including a processor and a memory. The memory is configuredto store a program, and the processor invokes the program stored in thememory, to perform the method in the eighth aspect or any implementationof the eighth aspect. The communications apparatus may be an SMF node,or may be at least one processing element or chip.

According to a twenty-ninth aspect, a communications apparatus isprovided, including a processor and a memory. The memory is configuredto store a program, and the processor invokes the program stored in thememory, to perform the method in the ninth aspect or any implementationof the ninth aspect. The communications apparatus may be an SMF node, ormay be at least one processing element or chip.

According to a thirtieth aspect, a communications apparatus is provided,including a processor and a memory. The memory is configured to store aprogram, and the processor invokes the program stored in the memory, toperform the method in the tenth aspect or any implementation of thetenth aspect. The communications apparatus may be an SMF node, or may beat least one processing element or chip.

According to a thirty-first aspect, a program is provided, and theprogram is used to perform the method in any aspect of the first aspectto the tenth aspect when the program is executed by a processor.

According to a thirty-second aspect, a computer readable storage mediumis provided, including the program in the thirty-first aspect.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic architectural diagram of a 5G communicationssystem;

FIG. 2 is a schematic diagram of a communication method according to afirst embodiment of this application;

FIG. 3 is a schematic diagram of a communication method according to asecond embodiment of this application;

FIG. 4 is a schematic diagram of a communication method according to athird embodiment of this application;

FIG. 5 is a schematic diagram of a communication method according to afourth embodiment of this application;

FIG. 6 is a schematic diagram of a communication method according to afifth embodiment of this application;

FIG. 7 is a schematic diagram of a communication method according to asixth embodiment of this application;

FIG. 8 is a schematic diagram of a communication method according to aseventh embodiment of this application;

FIG. 9 is a schematic diagram of a communication method according to aneighth embodiment of this application;

FIG. 10 is a schematic structural diagram of a communications apparatusaccording to a ninth embodiment of this application;

FIG. 11 is a schematic structural diagram of a communications apparatusaccording to a tenth embodiment of this application;

FIG. 12 is a schematic structural diagram of a communications apparatusaccording to an eleventh embodiment of this application;

FIG. 13 is a schematic structural diagram of a communications apparatusaccording to a twelfth embodiment of this application;

FIG. 14 is a schematic structural diagram of a communications apparatusaccording to a thirteenth embodiment of this application;

FIG. 15 is a schematic structural diagram of a communications apparatusaccording to a fourteenth embodiment of this application;

FIG. 16 is a schematic structural diagram of a communications apparatusaccording to a fifteenth embodiment of this application;

FIG. 17 is a schematic structural diagram of a communications apparatusaccording to a sixteenth embodiment of this application;

FIG. 18 is a schematic structural diagram of a communications apparatusaccording to a seventeenth embodiment of this application;

FIG. 19 is a schematic structural diagram of a communications apparatusaccording to an eighteenth embodiment of this application;

FIG. 20 is a schematic structural diagram of a communications apparatusaccording to a nineteenth embodiment of this application; and

FIG. 21 is a schematic structural diagram of a communications apparatusaccording to a twentieth embodiment of this application.

DESCRIPTION OF EMBODIMENTS

The following describes the technical solutions in the embodiments ofthis application with reference to the accompanying drawings in theembodiments of this application.

The embodiments of this application may be applied to a 5Gcommunications system, or may be applied to a subsequent evolved system.

FIG. 1 is an architectural diagram of a 5G communications system. The 5Gcommunications system mainly includes: an AMF node, an SMF node, a userplane function (UPF) node, a policy control function (PCF) node, aunified device management (UDM) node, an application function (AF) node,a data network (DN) node, an authentication server function (AUSF) node(R)AN) node, and a terminal device.

The (R)AN node implements a radio physical layer function, resourcescheduling and radio resource management, and a radio access control andmobility management function. The (R)AN may be connected to the UPF nodeusing a user plane interface N3, to transfer data of the terminaldevice. A control plane signaling connection may be further establishedbetween the (R)AN node and the AMF node using a control plane interfaceN2, to implement functions such as radio access bearer control.

The AMF node is mainly responsible for functions such as terminal deviceauthentication, mobility management, network slice selection, and SMFnode selection. As an anchor for an N1 signaling connection and an N2signaling connection, the AMF node also routes an N1/N2 sessionmanagement (SM) message to the SMF node, and maintains and managesstatus information of the terminal device.

The SMF node is mainly responsible for session management of theterminal device, including UPF node selection, Internet Protocol (IP)address assignment, quality of service (QoS) management of a session,obtaining a policy and charging control (PCC) policy from the PCF node,and the like.

The UPF node serves as an anchor of a PDU session connection. The UPFnode is responsible for data packet filtering of user equipment, datatransmission/forwarding, rate control, charging information generation,and the like.

The PCF node assigns a security policy to a network entity (for example,the AN node or the UPF node).

The UDM node stores subscription information of a user.

The DN provides an external data network service.

The AF node provides an application layer service.

The AUSF node is used for security authentication between the terminaldevice and a network side.

The terminal device may include various handheld devices,vehicle-mounted devices, wearable devices, or computing devices thathave a wireless communication function or another processing deviceconnected to a wireless modem; and terminals, mobile stations (MS), userequipment (UE), software terminals, and the like that are in variousforms, such as a water meter, an electricity meter, or a sensor.

In this application, specific procedures of activating a session anddeactivating a session may use a method in other approaches. This is notlimited.

In this application, “a plurality of” means two or more, and “and/or”describes an association relationship between associated objects andrepresents that three relationships may exist. For example, A and/or Bmay represent the following three cases: Only A exists, both A and Bexist, and only B exists. The character “/” generally indicates an “or”relationship between the associated objects.

In this application, a sequence of performing steps in each embodimentis not strictly limited, and may be exchanged or adjusted. Mutualreference may be made to the embodiments. Same or similar steps or nounsare not described one by one again.

In this application, related messages may be implemented in a servicemanner. In other words, the messages may be replaced with correspondingservice messages. This is not limited. In addition, both the AMF nodeand the SMF node may be replaced with a device that has a same orsimilar function, and may be independent physical devices or may befunction modules on a physical device. This is not limited.

It should be noted that the example mentioned in this application doesnot mean that the example is optimal. “First”, “second”, and the likementioned in this application are merely used to distinguish betweendifferent information, messages, or other objects, and do not mean asequence relationship.

The following case is found in a research process: When a terminaldevice moves from an AN node 1 to an AN node 2, a state of the terminaldevice on an AMF node is a connection management (CM)-CONNECTED(CM-Connected) state. It indicates that an N2 signaling connection ismaintained between the AMF node and the AN node 1. The AMF node firstreceives non-access stratum (NAS) signaling request of the terminaldevice from the AN node 2, where the NAS signaling request carries anidentifier of a to-be-activated packet data unit (PDU) session (PDUsession ID(s) to be activated), for example, a registration request or aservice request. The AMF node directly requests an SMF node to activatea session. Then, when the AMF node receives a list of active sessions ofthe terminal device from the AN node 1, for example, a list of sessionidentifiers of PDU sessions with an active N3 interface user planetunnel (List of PDU session ID(s) with active N3 user plane), the AMFnode requests the SMF node to deactivate the session. When the PDUsession ID(s) to be activated and the List of PDU session ID(s) withactive N3 user plane are intersected or overlapped or partially thesame, a session that the terminal device requests to activate is finallydeactivated. In other words, the session activation fails.

For the foregoing found problem, this application provides the followingembodiments, to resolve the foregoing problem.

As shown in FIG. 2, a first embodiment of this application provides acommunication method. The method may be applied to a scenario in which aterminal device moves from a first AN node to a second AN node. Themethod is as follows.

201. An AMF node receives identification information of ato-be-activated session from the terminal device using the second ANnode.

The identification information of the to-be-activated session may beused to identify the to-be-activated session. The identificationinformation may be an identifier of the session, for example, a sessionID; or may be a bit string. For example, each bit in the bit string maycorrespond to one session. A bit “1” may indicate that a sessioncorresponding to the bit is a to-be-activated session. In other words,the session needs to be activated. For example, a bit string is“1001000000101101”, and corresponds to sixteen sessions in total from afirst session to a sixteenth session. The first session, a thirdsession, a fourth session, a sixth session, a thirteenth session, and asixteenth session need to be activated, in other words, areto-be-activated sessions. Each session may correspond to a session ofdifferent numbers. For example, when sessions are numbered from 1, thefirst session, the third session, the fourth session, the sixth session,the thirteenth session, and the sixteenth session may be respectively asession 1, a session 3, a session 4, a session 6, a session 13, and asession 16. When sessions are numbered from 0, the first session, thethird session, the fourth session, the sixth session, the thirteenthsession, and the sixteenth session may be respectively a session 0, asession 2, a session 3, a session 5, a session 12, and a session 15.Certainly, the identification information of the to-be-activated sessionmay alternatively be indication information in another form.

The identification information of the to-be-activated session may becarried in a registration request message or a service request message.The registration request message or the service request message maycarry identification information of one or more to-be-activatedsessions. This is not limited.

For example, the terminal device may be in a radio resource control(RRC) inactive (RRC-inactive) state in a service range of the first ANnode. After the terminal device moves to the second AN node, theterminal device initiates an RRC connection resume procedure. When theRRC connection resume fails (for example, because the second AN nodedoes not support RRC-inactive sate), the terminal device switches to aCM-IDLE state, and initiates a registration request procedure or aservice request procedure. To be more specific, the terminal devicesends a registration request message or a service request message to thesecond AN node. The registration request message or the service requestmessage may carry the identification information of the to-be-activatedsession.

The to-be-activated session may be a session that the terminal devicerequests to activate. This is not limited.

202. The AMF node sends a context release command to the first AN nodewhen a signaling connection of the terminal device exists between theAMF node and the first AN node.

The context release command is used to instruct to release a context ofthe terminal device, and the context release command may carryidentification information of the terminal device.

The identification information of the terminal device may be anext-generation application protocol identifier assigned by the first ANnode to the terminal device (AN UE NG-AP ID), or an N2 interfaceapplication protocol identifier assigned by the first AN node to theterminal device (AN UE N2-AP ID).

The signaling connection may be used to transmit signaling of theterminal device, for example, signaling sent by the AMF node to theterminal device or signaling sent by the terminal device to the AMFnode. The signaling connection may be a non-access stratum (NAS)connection or an N2 connection. For example, when a CM state of theterminal device on the AMF node is a CM-CONNECTED state, the AMF nodemay determine that the signaling connection of the terminal deviceexists between the AMF node and the first AN node. Optionally, when thesignaling connection of the terminal device exits between the AMF nodeand the first AN node, it also means that a NAS signaling connection ofthe terminal device exists between the AMF node and the terminal device.

203. The AMF node receives a context release complete message from thefirst AN node, where the context release complete message carriesidentification information of an active session of the terminal device.

The identification information of the active session is used to identifythe active session, and may be an ID of the session or may be a bitstring. For example, each bit in the bit string may correspond to onesession. For example, a bit “1” may indicate that a sessioncorresponding to the bit is in an active state. This is similar to thebit string of the to-be-activated session. Details are not describedagain. For example, the identification information of the active sessionmay be a List of PDU session ID(s) with active N3 user plane.

The active session may be an active session of the terminal device onthe first AN node. This is not limited.

It should be noted that there may be one or more to-be-activatedsessions in step 201, and there may also be one or more active sessionsin step 203. This is not limited.

204. When the to-be-activated session and the active session have a samesession, the AMF node sends a 2 a request message to an SMF nodecorresponding to the same session.

That the to-be-activated session and the active session have a samesession may be as follows: The to-be-activated session and the activesession are intersected or overlapped or have at least one same session.Correspondingly, the same session may be referred to as a session in anintersection set or a session in an overlapping area. This is notlimited.

For example, when a quantity of to-be-activated sessions and a quantityof active sessions are both 1, that the to-be-activated session and theactive session have a same session may be as follows: Theto-be-activated session is the same as the active session.

For another example, when a quantity of to-be-activated sessions and aquantity of active sessions are both greater than 1, that theto-be-activated session and the active session have a same session maybe as follows: The to-be-activated session and the active session areintersected or overlapped. There may be one or more sessions in anintersection set or an overlapping area. For example, if the quantity ofto-be-activated sessions is 1, and the quantity of active sessions isgreater than 1, the active sessions include the to-be-activated session.If the quantity of to-be-activated sessions is greater than 1, and thequantity of active sessions is 1, the to-be-activated sessions includethe active session.

The 2 a request message may be used to request to deactivate the samesession, and may carry identification information of the same session.The identification information of the same session is used to identifythe same session, and may be an identifier of the session or a bitstring. For example, each bit in the bit string may correspond to onesession, and a bit “1” may indicate that a session corresponding to thebit is a same session. For details, refer to the related descriptions ofthe identification information of the to-be-activated session. Detailsare not described again.

For example, the 2 a request message may be an update session managementcontext request message, for example, an Nsmf_PDUSession_updateSMContextRequest message. The message may carry deactivation indicationinformation. The deactivation indication information is used to indicatethat the update session management context request message is used torequest to deactivate a session.

It should be noted that a quantity of 2 a request messages sent by theAMF node may be the same as a quantity of different SMF nodescorresponding to the same session.

In a first example, when the same session corresponds to a same SMFnode. For example, when a quantity of same sessions is 1, there may beone 2a request message, and the 2 a request message carriesidentification information of the same session.

In a second example, when the same sessions correspond to different SMFnodes, there may be a plurality of 2 a request messages. In this case,that the AMF node sends a 2 a request message to an SMF nodecorresponding to the same session in step 204 may be as follows: The AMFnode sends a 2 a request message to each of different SMF nodescorresponding to the same sessions. In this case, the 2 a requestmessage may carry identification information of some sessions in thesame sessions.

For example, it is assumed that different SMF nodes corresponding to thesame sessions include an SMF node 1 and an SMF node 2. In this case,that the AMF node sends a 2 a request message to an SMF nodecorresponding to the same session in step 204 may be as follows: The AMFnode sends a 2 a request message to the SMF node 1, where the 2 arequest message is used to request to deactivate a session correspondingto the SMF node 1 in the same session; and the AMF node sends a 2 arequest message to the SMF node 2, where the 2 a request message is usedto request to deactivate a session corresponding to the SMF node 2 inthe same session.

The SMF node corresponding to the same session may be an SMF node thatprovides a service for the same session. This is not limited.

205. The AMF node sends a 2 b request message to the SMF node after thesame session is deactivated.

The 2 b request message may be used to request to activate the samesession, and may carry the identification information of the samesession. Refer to the foregoing related descriptions.

In addition, there may be one or more 2 b request messages. This issimilar to the 2 a request message in step 204. Details are notdescribed again.

For example, the 2 b request message may be an update session managementcontext request message, for example, an Nsmf_PDUSession_updateSMContextRequest message. The message may carry activation indicationinformation. The activation indication information is used to indicatethat the update session management context request message is used torequest to activate a session.

It should be noted that the activation indication information and thedeactivation indication information may be different values set for asame indication bit. This is not limited.

For example, after receiving a response message corresponding to the 2 arequest message from the SMF node, the AMF node sends the 2 b requestmessage to the SMF node. For example, it is assumed that the 2 a requestmessage is an Nsmf_PDUSession_updateSMContext Request. In this case,when the AMF node receives the response messageNsmf_PDUSession_updateSMContext Response corresponding to the 2 arequest message, it may indicate that the same session has beendeactivated.

In the method provided in the foregoing embodiment, after receiving theidentification information of the to-be-activated session from theterminal device using the second AN node, the AMF node does notimmediately send, to an SMF node, a message used to request to activatethe session. Instead, the AMF node releases the signaling connectionwhen the signaling connection of the terminal device exists between theAMF node and the first AN node. For example, the AMF node sends thecontext release command to the first AN node, and receives theidentification information of the active session of the terminal device.When the active session and the to-be-activated session have the samesession, the AMF node first requests to deactivate the same session andthen requests to activate the same session. In this way, an activationfailure problem caused in other approaches because it is requested todeactivate a session just after it is requested to activate the sessionis resolved, thereby improving a success rate of session activation andimproving user experience.

As shown in FIG. 3, a second embodiment of this application provides acommunication method. The method may be applied to a scenario in which aterminal device moves from a first AN node to a second AN node. Themethod is as follows.

301. An AMF node receives identification information of ato-be-activated session from the terminal device using the second ANnode.

The identification information of the to-be-activated session may becarried in a registration request message or a service request message.The registration request message or the service request message maycarry identification information of one or more to-be-activatedsessions. This is not limited.

For example, the terminal device may be in an RRC-inactive state in aservice range of the first AN node. After the terminal device moves tothe second AN node, the terminal device initiates an RRC connectionresume procedure. The terminal device switches to a CM-IDLE state, andinitiates a registration request procedure or a service requestprocedure. To be more specific, the terminal device sends a registrationrequest message or a service request message to the second AN node. Theregistration request message or the service request message may carrythe identification information of the to-be-activated session.

302. The AMF node sends a context release command to the first AN nodewhen a signaling connection of the terminal device exists between theAMF node and the first AN node.

The context release command may be used to instruct to release a contextof the terminal device, and the context release command may carryidentification information of the terminal device. For details, refer tothe related descriptions of step 202. Details are not described again.

303. The AMF node receives a context release complete message from thefirst AN node.

The context release complete message carries identification informationof an active session of the terminal device. The active session may bean active session of the terminal device on the first AN node. This isnot limited.

304. When the to-be-activated session and the active session have a samesession, the AMF node sends a 3 a request message to an SMF nodecorresponding to the same session.

The 3 a request message may be used to request to activate the samesession, and may carry identification information of the same session.Refer to the related descriptions of the 2 b request message in theembodiment shown in FIG. 2. Details are not described again.

305. The SMF node receives the 3 a request message.

306. When the session requested to be activated using the 3 a requestmessage is in an active state, the SMF node deletes (R)AN tunnelinformation ((R)AN tunnel info) of the session.

For example, after receiving the 3 a request message, and beforeactivating the session based on the 3 a request message, the SMF nodedetermines whether the session is in the active state. If the session isin the active state, for example, the SMF node stores a state of thesession, and the state that is corresponding to the session and that isstored in the SMF node is the active state (for example, a sessioncontext that is of the session and that is maintained by the SMF nodeincludes the (R)AN tunnel information), the SMF node deletes the (R)ANtunnel information of the session. If the session is in a deactivatedstate (for example, the session context that is of the session and thatis maintained by the SMF node does not include the (R)AN tunnelinformation), the SMF node activates the session.

It is assumed that the SMF node receives the 3 a request message torequest to activate sessions 1 and 2, a state of the session 1 on theSMF node is the active state, and a state of the session 2 on the SMFnode is the deactivated state. In this case, the SMF node deletes (R)ANtunnel information of the session 1, and activates the session 2.

It should be noted that there may be one or more sessions requested tobe activated using the 3 a request message. However, the sessionrequested to be activated using the 3 a request message in step 306 maybe some sessions in all sessions requested to be activated using the 3 arequest message, for example, an active session on the SMF node. This isnot limited.

Optionally, after step 306, the method further includes: The SMF nodesends a 3 a response message to the AMF node, where the 3 a responsemessage carries core network tunnel information of the session.

For example, the 3 a request message may be an update session managementcontext request message, for example, an Nsmf_PDUSession_updateSMContextRequest message. The message may carry activation indicationinformation. The activation indication information is used to indicatethat the update session management context request message is used torequest to activate a session. The 3 a response message may be anNsmf_PDUSession_updateSMContext Response.

The core network tunnel information may include N3 interface tunnelidentifier information assigned by the SMF node or a UPF node to asession of the terminal device. Optionally, when an N3 interface uses aGeneral Packet Radio Service (GPRS) tunneling protocol-user plane(GTP)-User Plane (GTP-U) protocol, the core network tunnel informationis N3 interface GTP-U tunneling protocol identifier information assignedby the SMF node or the UPF node to the session of the terminal device.

The (R)AN tunnel information may include N3 interface tunnel identifierinformation assigned by the AN node to the session of the terminaldevice. Optionally, when the N3 interface uses the GTP-U protocol, the(R)AN tunnel information is N3 interface GTP-U tunneling protocolidentifier information assigned by the AN node to the session of theterminal device.

Optionally, the foregoing method further includes: When theto-be-activated session and the active session have a different session,the AMF node sends a 3 b request message to an SMF node corresponding tothe to-be-activated session, and sends a 3 c request message to an SMFnode corresponding to the active session.

The 3 b request message may be used to request to activate a sessionthat is in the to-be-activated session but not in the active session. Inother words, the 3 b request message is used to request to activate asession in the to-be-activated session except an intersection set or anoverlapping area between the to-be-activated session and the activesession. For example, if the intersection set or the overlapping areadoes not exist between the to-be-activated session and the activesession, the 3 b request message may be used to request to activate theto-be-activated session. For example, the 3 b request message may be anupdate session management context request message, for example, anNsmf_PDUSession_updateSMContext Request message. The message may carryactivation indication information. The activation indication informationis used to indicate that the update session management context requestmessage is used to request to activate a session.

For example, the 3 b request message may carry identificationinformation of the session that is in the to-be-activated session butnot in the active session. The identification information may be anidentifier of the session or a bit string. For example, each bit in thebit string may correspond to one session, and a bit “1” may indicatethat a session corresponding to the bit is a session requested to beactivated. Refer to the foregoing related descriptions. Details are notdescribed again.

The 3 c request message is used to request to deactivate a session thatis in the active session but not in the to-be-activated session. Inother words, the 3 c request message is used to request to deactivate asession in the active session except the intersection set or theoverlapping area between the to-be-activated session and the activesession. For example, if the intersection set or the overlapping areadoes not exist between the to-be-activated session and the activesession, the 3 c request message may be used to request to deactivatethe active session. For example, the 3 c request message may be anupdate session management context request message, for example, anNsmf_PDUSession_updateSMContext Request message. The message may carrydeactivation indication information. The deactivation indicationinformation is used to indicate that the update session managementcontext request message is used to request to deactivate a session.

For example, the 3 c request message may carry identificationinformation of the session that is in the active session but not in theto-be-activated session. The identification information may be anidentifier of the session or a bit string. For example, each bit in thebit string may correspond to one session, and a bit “1” may indicatethat a session corresponding to the bit is a session requested to bedeactivated. Refer to the foregoing related descriptions. Details arenot described again.

It should be noted that the activation indication information and thedeactivation indication information may be different values set for asame indication bit. This is not limited.

It should be noted that there may be one or more 3 b request messages,and a quantity of 3 b request messages may be the same as a quantity ofSMF nodes corresponding to sessions requested to be activated; andsimilarly, there may also be one or more 3 c request messages, and aquantity of 3 c request messages may be the same as a quantity of SMFnodes corresponding to sessions requested to be deactivated.

For example, it is assumed that to-be-activated sessions includesessions 1, 2, 3, and 4, active sessions include sessions 2, 4, 5, and6, the sessions 1, 2, and 3 correspond to an SMF node 1, the sessions 4and 5 correspond to an SMF node 2, and the session 6 corresponds to anSMF node 3. In this case, the 3 b request message is used to request toactivate the sessions 1 and 3, and the 3 b request message may includeonly one message and be sent to the SMF node 1. The 3 c request messagemay include two messages. A 3 c request message 1 sent to the SMF node 2is used to request to deactivate the session 5, and a 3 c requestmessage 2 sent to the SMF node 3 is used to request to deactivate thesession 6.

Based on the foregoing embodiment, this application further provides analternative method. The 3 a request message carries deletion indicationinformation. The deletion indication information is used to indicate todelete (R)AN tunnel information of the session requested to be activatedusing the 3 a request message. Step 306 may be replaced with thefollowing: The SMF node deletes, according to the deletion indicationinformation, the (R)AN tunnel information of the session requested to beactivated using the 3 a request message, and sends a response message tothe AMF node, where the response message carries the core network tunnelinformation of the session.

For the core network tunnel information, refer to the foregoing relateddescriptions. Details are not described again.

Based on the foregoing embodiment, this application further providesanother alternative method. The 3 a request message is used to requestto first deactivate a session and then reactivate the session. Step 306may be replaced with the following: The SMF node deletes (R)AN tunnelinformation of the session based on the 3 a request message, and sends aresponse message to the AMF node, where the response message carries thecore network tunnel information of the session.

It should be noted that in steps 301 and 302, the AMF node does notimmediately initiate a session activation procedure (in other words,delays initiation of the session activation procedure) when receiving aregistration request message or a service request message (carrying theidentification information of the to-be-activated session); and instead,the AMF node determines whether the signaling connection of the terminaldevice exists between the AMF node and the first AN node, and mayinstruct the first AN node to release the context of the terminal deviceif the signaling connection exists or may initiate the sessionactivation procedure if the signaling connection does not exit.

In the method provided in the foregoing embodiment, after receiving theidentification information of the to-be-activated session from theterminal device using the second AN node, the AMF node does notimmediately send, to the SMF node, a message used to request to activatethe session. Instead, the AMF node releases the signaling connection ofthe terminal device when the signaling connection of the terminal deviceexists between the AMF node and the first AN node. For example, the AMFnode sends the context release command to the first AN node, andreceives the identification information of the activated session of theterminal device. When the active session and the to-be-activated sessionhave the same session, the AMF node first requests to deactivate thesame session and then requests to activate the same session, or the AMFnode requests to activate the same session. In this way, an activationfailure problem caused in other approaches because it is requested todeactivate a session just after it is requested to activate the sessionis resolved, thereby improving a success rate of session activation andimproving user experience.

As shown in FIG. 4, a third embodiment of this application provides acommunication method. The method is applied to a scenario in which aterminal device moves from a first AN node to a second AN node. Theterminal device may be in an inactive state. The method is as follows.

401. An AMF node receives identification information of ato-be-activated session from the terminal device using the second ANnode.

The identification information of the to-be-activated session may becarried in a registration request message or a service request message.The registration request message or the service request message maycarry identification information of one or more to-be-activatedsessions. This is not limited.

For example, the terminal device may be in an RRC-inactive state in aservice range of the first AN node. After the terminal device moves tothe second AN node, the terminal device initiates an RRC connectionresume procedure. The terminal device switches to a CM-IDLE state, andinitiates a registration request procedure or a service requestprocedure. To be more specific, the terminal device sends a registrationrequest message or a service request message to the second AN node. Theregistration request message or the service request message may carrythe identification information of the to-be-activated session.

402. The AMF node sends a 4 a request message to an SMF node based onthe identification information of the to-be-activated session.

The 4 a request message is used to request to activate theto-be-activated session, and may carry the identification information ofthe to-be-activated session. The identification information is used toidentify the to-be-activated session. Refer to the related descriptionsin the embodiment shown in FIG. 2. Details are not described again. Forexample, the 4 a request message may be an update session managementcontext request message, for example, an Nsmf_PDUSession_updateSMContextRequest message. The message may carry activation indicationinformation. The activation indication information is used to indicatethat the update session management context request message is used torequest to activate a session.

The SMF node may be an SMF node corresponding to the to-be-activatedsession. In addition, there may be one or more 4 a request messages. Forexample, a quantity of 4 a request messages may be the same as aquantity of SMF nodes corresponding to the to-be-activated session. Thisis not limited. For example, to-be-activated sessions include sessions1, 2, 3, and 4, the sessions 1 and 2 correspond to an SMF node 1, andthe sessions 3 and 4 correspond to an SMF node 2. The 4 a requestmessage may include two messages. One message is sent to the SMF node 1,and the message carries identification information of the sessions 1 and2; and the other message is sent to the SMF node 2, and the messagecarries identification information of the sessions 3 and 4.

403. The SMF node receives the 4 a request message.

404. When the session requested to be activated using the 4 a requestmessage is in an active state, the SMF node deletes (R)AN tunnelinformation ((R)AN tunnel info) of the session.

For step 404, refer to the related descriptions of step 306. This is notlimited.

Optionally, after step 404, the method further includes: The SMF nodesends core network tunnel information of the session to the AMF node.The core network tunnel information may be carried in a response messagecorresponding to the 4 a request message.

For example, the 4 a request message may be an update session managementcontext request message, for example, an Nsmf_PDUSession_updateSMContextRequest message. The message may carry activation indicationinformation. The activation indication information is used to indicatethat the update session management context request message is used torequest to activate a session. The response message corresponding to the4 a request message may be an Nsmf_PDUSession_updateSMContext Response.

405. The AMF node sends a context release command to the first AN nodewhen a signaling connection of the terminal device exists between theAMF node and the first AN node.

The context release command is used to instruct to release a context ofthe terminal device.

406. The AMF node receives a context release complete message from thefirst AN node.

The context release complete message carries identification informationof an active session of the terminal device. The active session may bean active session of the terminal device on the first AN node. This isnot limited.

407. When the to-be-activated session and the active session have a samesession, the AMF node skips sending a 4 b request message to an SMF nodecorresponding to the same session.

The 4 b request message is used to request to deactivate the samesession. For the 4 b request message, refer to the related descriptionsof the 2 a request message. Details are not described again.

It should be noted that a sequence of performing steps 403 and 404 and asequence of performing steps 405 to 407 may be exchanged, or steps 403and 404 and steps 405 to 407 may be simultaneously performed. This isnot limited.

Optionally, the method further includes: When the to-be-activatedsession and the active session have a different session, the AMF nodesends, to an SMF node corresponding to the active session, a requestmessage used to request to deactivate a session that is in the activesession but not in the to-be-activated session. For details, refer tothe related descriptions of the 3 c request message. Details are notdescribed again.

In the method provided in the foregoing embodiment, after receiving theidentification information of the to-be-activated session from theterminal device using the second AN node, the AMF node immediatelyrequests the SMF node to activate the session. The AMF node releases thesignaling connection when the signaling connection of the terminaldevice exists between the AMF node and the first AN node. For example,the AMF node sends the context release command to the first AN node, andreceives the identification information of the active session of theterminal device. When the active session and the to-be-activated sessionhave the same session, the AMF node no longer requests to deactivate thesame session. In this way, an activation failure problem caused in otherapproaches because it is requested to deactivate a session just after itis requested to activate the session is resolved, thereby improving asuccess rate of session activation and improving user experience.

As shown in FIG. 5, a fourth embodiment of this application provides acommunication method. The communication method is applied to a scenarioin which a terminal device moves from a first AN node to a second ANnode. The first AN node is managed by a first AMF node, and the secondAN node is managed by a second AMF node. The method is as follows.

501. The second AMF node receives identification information of ato-be-activated session from the terminal device using the second ANnode.

The identification information of the to-be-activated session may becarried in a registration request message or a service request message.The registration request message or the service request message maycarry identification information of one or more to-be-activatedsessions. This is not limited.

For example, the terminal device may be in an RRC-inactive state in aservice range of the first AN node. After the terminal device moves tothe second AN node, the terminal device initiates an RRC connectionresume procedure. The terminal device switches to a CM-IDLE state, andinitiates a registration request procedure or a service requestprocedure. To be more specific, the terminal device sends a registrationrequest message or a service request message to the second AN node. Theregistration request message or the service request message may carrythe identification information of the to-be-activated session.

502. The second AMF node sends a 5 a request message to the first AMFnode.

The 5 a request message may be used to request a context of the terminaldevice, and the 5 a request message may be a context transfer request,for example, a Namf_Communication_UEContextTransfer Request. Forexample, the 5 a request message may carry identification information ofthe terminal device, for example, 5G-globally unique temporary identity(GUTI) (5G-GUTI).

The context may be a mobility management (MM) context.

For example, the registration request message or the service requestmessage in step 501 may carry the 5G-GUTI, and the second AMF node mayobtain an address of the first AMF node based on the 5G-GUTI and sendthe 5 a request message to the first AMF node.

503. The first AMF node receives the 5 a request message from the secondAMF node.

504. The first AMF node sends a context release command to the first ANnode when a signaling connection of the terminal device exists betweenthe first AMF node and the first AN node.

The context release command is used to instruct to release a context ofthe terminal device.

505. The first AN node receives the context release command, and deletesthe context of the terminal device.

For example, before deleting the context of the terminal device, thefirst AN node may determine whether an (R)AN connection exists betweenthe first AN node and the terminal device. If the (R)AN connectionexists, the first AN node releases the (R)AN connection. For example,the first AN node sends the RRC connection release message to theterminal device.

The (R)AN connection may include an RRC connection or an NWu connection,where NWu is a logical interface between the terminal device and anon-3GPP interworking function (N3IWF).

506. The first AN node sends a context release complete message to thefirst AMF node.

The context release complete message carries identification informationof an active session of the terminal device. The active session may bean active session of the terminal device on the first AN node. This isnot limited.

507. The first AMF node receives the context release complete message,and sends a 5 b request message to an SMF node corresponding to theactive session.

The 5 b request message is used to request to deactivate the activesession, and may carry the identification information of the activesession. The identification information is used to identify the activesession. Refer to the related descriptions in the embodiment shown inFIG. 2. For example, the 5 b request message may be an update sessionmanagement context request message, for example, anNsmf_PDUSession_updateSMContext Request message. The message may carrydeactivation indication information. The deactivation indicationinformation is used to indicate that the update session managementcontext request message is used to request to deactivate a session.

There may be one or more 5 b request messages. For example, a quantityof 5 b request messages may be the same as a quantity of SMF nodescorresponding to the active session. This is not limited. For example,active sessions include sessions 1, 2, 3, and 4, the sessions 1 and 2correspond to an SMF node 1, and the sessions 3 and 4 correspond to anSMF node 2. The 5 b request message may include two messages. Onemessage is sent to the SMF node 1, and the message carriesidentification information of the sessions 1 and 2; and the othermessage is sent to the SMF node 2, and the message carriesidentification information of the sessions 3 and 4.

508. The first AMF node sends a 5 a response message to the second AMFnode after the active session is deactivated.

The 5 a response message may be used to respond to the 5 a requestmessage, and the 5 a response message carries an MM context of theterminal device. For example, a Namf_Communication_UEContextTransferResponse carries the MM context of the terminal device.

For example, after receiving a response message corresponding to the 5 brequest message from the SMF node, the first AMF node sends the 5 aresponse message to the second AMF node. For example, it is assumed thatthe 5 b request message is an Nsmf_PDUSession_updateSMContext Request.In this case, when the first AMF node receives the response messageNsmf_PDUSession_updateSMContext Response corresponding to the 5 brequest message, it may indicate that the same session has beendeactivated.

509. The second AMF node receives the 5 a response message, and sends a5 c request message to an SMF node corresponding to the to-be-activatedsession.

The 5 c request message is used to request to activate theto-be-activated session, and may carry the identification information ofthe to-be-activated session. For details, refer to the relateddescriptions of the 4 a request message. Details are not describedagain.

It should be noted that reference may be made to the relateddescriptions in the foregoing embodiments for steps and nouns in thisembodiment. Details are not described again.

According to the method provided in the foregoing embodiment, in themethod, the first AMF node receives, from the second AMF node, a messageused to request the context of the terminal device. The first AMF nodereleases the signaling connection when the signaling connection of theterminal device exists between the first AMF node and the first AN node.For example, after sending the context release command to the first ANnode and receiving the identification information of the active sessionof the terminal device, the first AMF node requests the SMF node todeactivate the active session, and sends the context of the terminaldevice to the second AMF node after the deactivation succeeds, such thatthe corresponding session has been successfully deactivated when thesecond AMF node receives the context of the terminal device and thenrequests to activate the session. In this way, an activation failureproblem caused in other approaches because it is requested to deactivatea session just after it is requested to activate the session isresolved, thereby improving a success rate of session activation andimproving user experience.

As shown in FIG. 6, a fifth embodiment of this application provides acommunication method. The communication method is applied to a scenarioin which a terminal device moves from a first AN node to a second ANnode. The first AN node is managed by a first AMF node, and the secondAN node is managed by a second AMF node. The method is as follows.

601. The second AMF node receives identification information of ato-be-activated session from the terminal device using the second ANnode.

The identification information of the to-be-activated session may becarried in a registration request message or a service request message.

For example, the terminal device may be in an RRC-inactive state in aservice range of the first AN node. After the terminal device moves tothe second AN node, the terminal device initiates an RRC connectionresume procedure. The terminal device switches to a CM-IDLE state, andinitiates a registration request procedure or a service requestprocedure. To be more specific, the terminal device sends a registrationrequest message or a service request message to the second AN node. Theregistration request message or the service request message may carrythe identification information of the to-be-activated session.

602. The second AMF node sends a 6 a request message to the first AMFnode.

The 6 a request message is used to request a mobility management contextof the terminal device. The 6 a request message may carry theidentification information of the to-be-activated session of theterminal device, and may further carry identification information of theterminal device. Refer to the foregoing related descriptions.

The to-be-activated session may be used by the first AMF node todeactivate a session that is in an active session of the terminal devicebut not in the to-be-activated session.

603. The first AMF node receives the 6 a request message from the secondAMF node.

604. The first AMF node sends a context release command to the first ANnode when a signaling connection of the terminal device exists betweenthe first AMF node and the first AN node.

The context release command is used to instruct to release a context ofthe terminal device, and may carry the identification information of theterminal device. Refer to the foregoing related descriptions.

605. The first AMF node receives a context release complete message fromthe first AN node.

The context release complete message carries identification informationof the active session of the terminal device. The active session may bean active session of the terminal device on the first AN node. This isnot limited.

606. The first AMF node sends a 6 a response message to the second AMFnode.

The 6 a response message may be used to respond to the 6 a requestmessage, and may carry the mobility management context of the terminaldevice.

In an example, when the to-be-activated session and the active sessionhave a same session, the 6 a response message may further carryidentification information of the same session. Alternatively, when theto-be-activated session and the active session do not have a samesession, the 6 a response message may further carry indicationinformation indicating that the same session does not exit. Theindication information is used to indicate that the to-be-activatedsession and the active session do not have the same session.

In another example, the 6 a response message may further carry theidentification information of the active session.

607. The second AMF node receives the 6 a response message from thefirst AMF node.

Steps 608 and 609 are optional steps. For example, when the 6 a responsemessage further carries the identification information of the activesession of the terminal device, step 608 is performed. When the 6 aresponse message further carries the identification information of thesame session, step 609 is performed. When the 6 a response messagefurther carries the indication information indicating that the samesession does not exist, steps 608 and 609 may not be performed. In otherwords, all subsequent steps are no longer performed. Instead, the secondAMF node sends, to an SMF node corresponding to the to-be-activatedsession, a request message used to request to activate theto-be-activated session. The request message may be an update sessionmanagement context request message. For details, refer to the relateddescriptions in the embodiment shown in FIG. 5. Details are notdescribed again.

608. When the to-be-activated session and the active session have thesame session, the second AMF node sends a 6 b request message to an SMFnode corresponding to the same session.

The 6 b request message may have the following three cases described asfollows.

Case 1: The 6 b request message is used to request to activate the samesession. For example, the 6 b request message may be an update sessionmanagement context request message, for example, anNsmf_PDUSession_updateSMContext Request message. The message may carryactivation indication information. The activation indication informationis used to indicate that the update session management context requestmessage is used to request to activate a session.

Case 2: The 6 b request message is used to request to activate the samesession, and the 6 b request message carries deletion indicationinformation. The deletion indication information is used to indicate todelete (R)AN tunnel information of the same session. For example, the 6b request message may be an update session management context requestmessage, for example, an Nsmf_PDUSession_updateSMContext Requestmessage. The message may carry activation indication information. Theactivation indication information is used to indicate that the updatesession management context request message is used to request toactivate a session. The deletion indication information may be directedto all or some sessions requested to be activated using the 6 b requestmessage. This is not limited.

Case 3: The 6 b request message is used to request to first deactivatethe same session and then reactivate the same session. For example, the6 b request message may be an update session management context requestmessage, for example, an Nsmf_PDUSession_updateSMContext Requestmessage. The message may carry activation/deactivation indicationinformation. The activation/deactivation indication information is usedto indicate that the update session management context request messageis used to request to deactivate a session and then reactivate thesession.

609. The second AMF node sends the 6 b request message to the SMF nodecorresponding to the same session.

The 6 b request message may have the foregoing three cases. Details arenot described herein again.

Steps 610 and 611 are optional steps. For example, in Case 1, steps 610and 612 are performed. In Case 2 or Case 3, steps 611 and 612 areperformed.

610. The SMF node receives the 6 b request message, and when the sessionrequested to be activated using the 6 b request message is in an activestate, the SMF node deletes (R)AN tunnel information of the session.

For step 610, refer to the related descriptions of step 306. Details arenot described again.

611. The SMF node receives the 6 b request message, and deletes the(R)AN tunnel information of the session based on the 6 b requestmessage.

For example, in Case 2, deleting the (R)AN tunnel information of thesession based on the 6 b request message may be deleting the (R)ANtunnel information of the session according to the deletion indicationinformation. In addition, when the deletion indication information isdirected to some sessions of the 6 b request message, step 611 isdeleting (R)AN tunnel information of these sessions.

For example, in Case 3, step 611 may be deleting (R)AN tunnelinformation of all sessions that are requested to be activated using the6 b request message.

612. The SMF node sends a 6 b response message to the second AMF node.

The 6 b response message may be used to respond to the 6 b requestmessage, and may carry core network tunnel information of the session.

For example, the 6 b response message may be anNsmf_PDUSession_updateSMContext Response.

Optionally, the foregoing method further includes the following:

When the to-be-activated session and the active session have a differentsession, the first AMF node sends a 6 c request message to an SMF nodecorresponding to a session that is in the active session but not in theto-be-activated session. The 6 c request message is used to request todeactivate the session that is in the active session but not in theto-be-activated session. For details, refer to the related descriptionsof the 3 c request message. Details are not described again.

It should be noted that reference may be made to the relateddescriptions in the foregoing embodiments for steps and nouns in thisembodiment. Details are not described again.

According to the method provided in this embodiment, the second AMF nodeprovides the identification information of the to-be-activated sessionto the first AMF node, and the first AMF node does not request the SMFnode to deactivate the to-be-activated session. In this way, anactivation failure problem caused in other approaches because it isrequested to deactivate a session just after it is requested to activatethe session is resolved, thereby improving a success rate of sessionactivation. In addition, in the method, the second AMF node requests theSMF node to delete the (R)AN tunnel information of the same session. Inthis way, a data transmission failure caused because a UPF node sendsdata of the terminal device to the first AN node based on theinformation is avoided.

As shown in FIG. 7, a sixth embodiment of this application provides acommunication method. The communication method is applied to a scenarioin which a terminal device moves from a first AN node to a second ANnode. The first AN node is managed by a first AMF node, and the secondAN node is managed by a second AMF node. The method is as follows.

701. The second AMF node receives identification information of ato-be-activated session from the terminal device using the second ANnode.

The identification information of the to-be-activated session may becarried in a registration request message or a service request message.For example, the terminal device may be in an RRC-inactive state in aservice range of the first AN node. After the terminal device moves tothe second AN node, the terminal device initiates an RRC connectionresume procedure. The terminal device switches to a CM-IDLE state, andinitiates a registration request procedure or a service requestprocedure. To be more specific, the terminal device sends a registrationrequest message or a service request message to the second AN node. Theregistration request message or the service request message may carrythe identification information of the to-be-activated session.

702. The second AMF node sends a 7 a request message to the first AMFnode.

The 7 a request message is used to request a context of the terminaldevice, for example, an MM context. The 7 a request message may carrythe identification information of the to-be-activated session of theterminal device, and may further carry identification information of theterminal device. Refer to the foregoing related descriptions.

The 7 a request message may be a context transfer request, for example,a Namf_Communication_UEContextTransfer Request.

703. The first AMF node receives the 7 a request message.

704. The first AMF node sends a 7 a response message to the second AMFnode.

The 7 a response message may be used to respond to the 7 a requestmessage, and may carry the MM context of the terminal device. Forexample, a Namf_Communication_UEContextTransfer Response carries the MMcontext of the terminal device.

705. After receiving the 7 a response message, the second AMF node sendsa 7 b request message to an SMF node corresponding to theto-be-activated session.

The 7 b request message is used to request to activate theto-be-activated session. For details, refer to the related descriptionsof the 4 a request message. Details are not described again.

706. The SMF node receives the 7 b request message, and when the sessionrequested to be activated using the 7 b request message is in an activestate, deletes (R)AN tunnel information of the session.

For step 706, refer to the related descriptions of step 306. This is notlimited.

Optionally, after step 706, the method further includes: The SMF nodesends core network tunnel information of the session to the AMF node.The core network tunnel information may be carried in a response messagecorresponding to the 7 b request message.

For example, the 7 b request message may be an update session managementcontext request message, for example, an Nsmf_PDUSession_updateSMContextRequest message. The message may carry activation indicationinformation. The activation indication information is used to indicatethat the update session management context request message is used torequest to activate a session. The response message corresponding to the7 b request message may be an Nsmf_PDUSession_updateSMContext Response.

707. The first AMF node sends a context release command to the first ANnode when a signaling connection of the terminal device exists betweenthe first AMF node and the first AN node.

The context release command is used to instruct to release a context ofthe terminal device, and may carry the identification information of theterminal device.

708. The first AMF node receives a context release complete message.

The context release complete message carries identification informationof an active session of the terminal device. The active session may bean active session of the terminal device on the first AN node. This isnot limited.

709. When the to-be-activated session and the active session have a samesession, the first AMF node skips sending, to an SMF node correspondingto the same session, a request message used to request to deactivate thesame session.

It should be noted that a sequence of performing steps 705 and 706 and asequence of performing steps 707 and 708 may be exchanged, or steps 705and 706 and steps 707 and 708 may be simultaneously performed. This isnot limited.

It should be noted that reference may be made to the relateddescriptions in the foregoing embodiments for steps and nouns in thisembodiment. Details are not described again.

Optionally, the foregoing method further includes the following.

When the to-be-activated session and the active session have a differentsession, the first AMF node sends a 7 c request message to an SMF nodecorresponding to a session that is in the active session but not in theto-be-activated session. The 7 c request message is used to request todeactivate the session that is in the active session but not in theto-be-activated session. For details, refer to the related descriptionsof the 3 c request message. Details are not described again.

According to the method provided in this embodiment, after receiving thefirst request message from the second AMF node, the first AMF nodeimmediately replies with the response message corresponding to the firstrequest message. In this way, the second AMF node requests to activatethe session after receiving the response message, and after receivingthe identification information of the active session, the first AMF nodedetermines whether the active session and the to-be-activated sessionhave the same session. The first AMF node does not request the SMF nodeto deactivate the same session. In this way, an activation failureproblem caused in other approaches because it is requested to deactivatea session just after it is requested to activate the session isresolved, thereby improving a success rate of session activation.

As shown in FIG. 8, a seventh embodiment of this application provides acommunication method. The method is described as follows.

801. An SMF node receives a request message from an AMF node.

The request message is used to request to activate a session, and therequest message carries deletion indication information. The deletionindication information is used to indicate to delete (R)AN tunnelinformation of the session.

In addition, the request message may carry identification information ofthe session. The identification information is used to identify thesession. Refer to the related descriptions in the foregoing embodiments.Details are not described again.

802. The SMF node deletes the (R)AN tunnel information of the sessionaccording to the deletion indication information.

For example, when the deletion indication information is directed tosome sessions of the request message, step 802 is deleting (R)AN tunnelinformation of these sessions. Details are not described again.

803. The SMF node sends a response message to the AMF node, where theresponse message carries core network tunnel information of the session.

Step 803 is an optional step.

For example, the request message may be an update session managementcontext request message, for example, an Nsmf_PDUSession_updateSMContextRequest message. The message may carry activation indicationinformation. The activation indication information is used to indicatethat the update session management context request message is used torequest to activate a session. The response message may be anNsmf_PDUSession_updateSMContext Response.

According to the method provided in the foregoing embodiment, the SMFnode receives the request message from the AMF node. The request messageis used to request to activate the session. The request message carriesthe deletion indication information. The deletion indication informationis used to indicate to delete the (R)AN tunnel information of thesession. The SMF node deletes the (R)AN tunnel information of thesession according to the deletion indication information. In this way,the (R)AN tunnel information is deleted, and a data transmission failurecaused because a UPF node sends data of a terminal device to a first ANnode based on the information is avoided.

As shown in FIG. 9, an eighth embodiment of this application provides acommunication method. The method is described as follows.

901. An SMF node receives a request message from an AMF node, where therequest message is used to request to first deactivate a session andthen reactivate the session.

The request message may carry identification information of the session.The identification information is used to identify the session. Refer tothe related descriptions in the foregoing embodiments. Details are notdescribed again.

902. The SMF node deletes (R)AN tunnel information of the session basedon the request message.

903. The SMF node sends a response message to the AMF node, where theresponse message carries core network tunnel information of the session.

Step 903 is an optional step.

For example, the request message may be an update session managementcontext request message, for example, an Nsmf_PDUSession_updateSMContextRequest message. The message may carry activation/deactivationindication information. The activation/deactivation indicationinformation is used to indicate that the update session managementcontext request message is used to request to deactivate a session andthen reactivate the session. The response message may be anNsmf_PDUSession_updateSMContext Response.

According to the method provided in the foregoing embodiment, the SMFnode receives the request message from the AMF node. The request messageis used to request to first deactivate the session and then reactivatethe session. The SMF node deletes the (R)AN tunnel information of thesession based on the request message. In this way, the (R)AN tunnelinformation is deleted, and a data transmission failure caused because aUPF node sends data of a terminal device to a first AN node based on theinformation is avoided.

As shown in FIG. 10, a ninth embodiment of this application provides acommunication method. The method is described as follows.

1001. An SMF node receives a request message from an AMF node, where therequest message is used to request to activate a session.

The request message may carry identification information of the session.The identification information is used to identify the session. Fordetails, refer to the related descriptions in the foregoing embodiments.Details are not described again.

1002. The SMF node deletes (R)AN tunnel information of the session whenthe session is in an active state.

For example, after receiving the request message and before activatingthe session based on the request message, the SMF node determineswhether the session is in the active state. If the session is in theactive state, for example, the SMF node stores a state of the sessionand the state that is corresponding to the session and that is stored inthe SMF node is the active state (for example, a session context that isof the session and that is maintained by the SMF node has the (R)ANtunnel information), the SMF node deletes the (R)AN tunnel informationof the session. If the session is in a deactivated state (for example,the session context that is of the session and that is maintained by theSMF node does not have the (R)AN tunnel information), the SMF nodeactivates the session.

Optionally, after step 1002, the method further includes the followingstep.

1003. The SMF node sends a response message to the AMF node, where theresponse message carries core network tunnel information of the session.

For example, the request message may be an update session managementcontext request message, for example, an Nsmf_PDUSession_updateSMContextRequest message. The message may carry activation indicationinformation. The activation/deactivation indication information is usedto indicate that the update session management context request messageis used to request to activate a session. The response message may be anNsmf_PDUSession_updateSMContext Response.

According to the method provided in the foregoing embodiment, the SMFnode receives the request message from the AMF node. The SMF nodedeletes the (R)AN tunnel information of the session when the session isin the active state. In this way, the (R)AN tunnel information isdeleted, and a data transmission failure caused because a UPF node sendsdata of a terminal device to a first AN node based on the information isavoided.

As shown in FIG. 11, a tenth embodiment of this application provides acommunications apparatus 1100. The apparatus 1100 may be applied to ascenario in which a terminal device moves from a first AN node to asecond AN node. The apparatus 1100 may be an AMF node or be inside theAMF node (for example, a chip or a system-on-a-chip). The apparatus 1100may be configured to perform an action of the AMF node in the methodembodiment shown in FIG. 2. The apparatus 1100 includes a transceiverunit 1101 and a processing unit 1102.

The transceiver unit 1101 is configured to receive identificationinformation of a to-be-activated session from the terminal device usingthe second AN node.

The processing unit 1102 is configured to send a context release commandto the first AN node when a signaling connection of the terminal deviceexists between the AMF node and the first AN node. The context releasecommand is used to instruct to release a context of the terminal device.

The transceiver unit 1101 is further configured to receive a contextrelease complete message from the first AN node. The context releasecomplete message carries identification information of an active sessionof the terminal device.

The processing unit 1102 is further configured to: when theto-be-activated session and the active session have a same session,send, using the transceiver unit 1101, a first request message to an SMFnode corresponding to the same session. The first request message isused to request to deactivate the same session.

The processing unit 1102 is further configured to send a second requestmessage to the SMF node using the transceiver unit 1101 after the samesession is deactivated. The second request message is used to request toactivate the same session.

Optionally, the identification information of the to-be-activatedsession is carried in a registration request message or a servicerequest message.

As shown in FIG. 12, an eleventh embodiment of this application providesa communications apparatus 1200. The apparatus 1200 may be applied to ascenario in which a terminal device moves from a first AN node to asecond AN node. The apparatus 1200 may be an AMF node or be inside theAMF node (for example, a chip or a system-on-a-chip). The apparatus 1200may be configured to perform an action of the AMF node in the methodembodiment shown in FIG. 3. The apparatus 1200 includes a transceiverunit 1201 and a processing unit 1202.

The transceiver unit 1201 is configured to receive identificationinformation of a to-be-activated session from the terminal device usingthe second AN node.

The processing unit 1202 is configured to send a context release commandto the first AN node when a signaling connection of the terminal deviceexists between the AMF node and the first AN node. The context releasecommand is used to instruct to release a context of the terminal device.

The transceiver unit 1201 is further configured to receive a contextrelease complete message from the first AN node. The context releasecomplete message carries identification information of an active sessionof the terminal device.

The processing unit 1202 is further configured to: when theto-be-activated session and the active session have a same session,send, using the transceiver unit 1201, a first request message to an SMFnode corresponding to the same session. The first request message isused to request to activate the same session, or the first requestmessage is used to request to deactivate the same session and thenreactivate the same session.

Optionally, the processing unit 1202 is further configured to: when theto-be-activated session and the active session have a different session,send a second request message to an SMF node corresponding to a sessionthat is in the to-be-activated session but not in the active session,and send a third request message to an SMF node corresponding to asession that is in the active session but not in the to-be-activatedsession.

The second request message is used to request to activate the sessionthat is in the to-be-activated session but not in the active session,and the third request message is used to request to deactivate thesession that is in the active session but not in the to-be-activatedsession.

Optionally, when the first request message is used to request toactivate the same session, the first request message carries deletionindication information, and the deletion indication information is usedto request to delete (R)AN tunnel information of the same session.

As shown in FIG. 13, a twelfth embodiment of this application provides acommunications apparatus 1300. The apparatus 1300 may be applied to ascenario in which a terminal device moves from a first AN node to asecond AN node. The apparatus 1300 may be an AMF node or be inside theAMF node (for example, a chip or a system-on-a-chip). The apparatus 1300may be configured to perform an action of the AMF node in the methodembodiment shown in FIG. 4. The apparatus 1300 includes a transceiverunit 1301 and a processing unit 1302.

The transceiver unit 1301 is configured to receive identificationinformation of a to-be-activated session from the terminal device usingthe second AN node.

The processing unit 1302 is configured to send a first request messageto an SMF node based on the identification information of theto-be-activated session using the transceiver unit 1301. The firstrequest message is used to request to activate the to-be-activatedsession.

The processing unit 1302 is further configured to send a context releasecommand to the first AN node using the transceiver unit 1301 when asignaling connection of the terminal device exists between the AMF nodeand the first AN node. The context release command is used to instructto release a context of the terminal device.

The transceiver unit 1301 is further configured to receive a contextrelease complete message from the first AN node. The context releasecomplete message carries identification information of an active sessionof the terminal device.

The processing unit 1302 is further configured to: when theto-be-activated session and the active session have a same session, skipsending a second request message to an SMF node corresponding to thesame session. The second request message is used to request todeactivate the same session.

As shown in FIG. 14, a thirteenth embodiment of this applicationprovides a communications apparatus 1400. The communications apparatus1400 may be applied to a scenario in which a terminal device moves froma first AN node to a second AN node. The first AN node is managed by afirst AMF node, and the second AN node is managed by a second AMF node.The apparatus 1400 may be the first AMF node or be inside the first AMFnode. For example, the apparatus 1400 may be configured to perform anaction of the first AMF node in the embodiment shown in FIG. 5. Theapparatus 1400 includes a transceiver unit 1401 and a processing unit1402.

The transceiver unit 1401 is configured to receive a first requestmessage from the second AMF node. The first request message is used torequest an MM context of the terminal device.

The processing unit 1402 is configured to send a context release commandto the first AN node using the transceiver unit 1401 when a signalingconnection of the terminal device exists between the first AMF node andthe first AN node. The context release command is used to instruct torelease a context of the terminal device.

The transceiver unit 1401 is further configured to receive a contextrelease complete message from the first AN node. The context releasecomplete message carries identification information of an active sessionof the terminal device.

The transceiver unit 1401 is further configured to send a second requestmessage to an SMF node corresponding to the active session. The secondrequest message is used to request to deactivate the active session.

The processing unit 1402 is further configured to send a first responsemessage to the second AMF node using the transceiver unit 1401 after theactive session is deactivated. The first response message carries the MMcontext of the terminal device.

As shown in FIG. 15, a fourteenth embodiment of this applicationprovides a communications apparatus 1500. The communications apparatus1500 may be applied to a scenario in which a terminal device moves froma first AN node to a second AN node. The first AN node is managed by afirst AMF node, and the second AN node is managed by a second AMF node.The apparatus 1500 may be the first AMF node or be inside the first AMFnode. For example, the apparatus 1500 may be configured to perform anaction of the first AMF node in the embodiment shown in FIG. 6. Theapparatus 1500 includes a transceiver unit 1501 and a processing unit1502.

The transceiver unit 1501 is configured to receive a first requestmessage from the second AMF node. The first request message is used torequest a mobility management context of the terminal device, and thefirst request message carries identification information of ato-be-activated session of the terminal device.

The processing unit 1502 is configured to send a context release commandto the first AN node using the transceiver unit 1501 when a signalingconnection of the terminal device exists between the first AMF node andthe first AN node. The context release command is used to instruct torelease a context of the terminal device.

The transceiver unit 1501 is further configured to receive a contextrelease complete message from the first AN node. The context releasecomplete message carries identification information of an active sessionof the terminal device.

The transceiver unit 1501 is further configured to send a first responsemessage to the second AMF node. The first response message carries themobility management context of the terminal device.

Optionally, when the to-be-activated session and the active session havea same session, the first response message further carriesidentification information of the same session; or when theto-be-activated session and the active session do not have a samesession, the first response message further carries indicationinformation, and the indication information is used to indicate that theto-be-activated session and the active session do not have the samesession.

Optionally, the first response message further carries identificationinformation of the active session.

Optionally, the processing unit 1502 is further configured to: when theto-be-activated session and the active session have a different session,send, using the transceiver unit 1501, a second request message to anSMF node corresponding to a session that is in the active session butnot in the to-be-activated session, where the second request message isused to request to deactivate the session that is in the active sessionbut not in the to-be-activated session.

As shown in FIG. 16, a fifteenth embodiment of this application providesa communications apparatus 1600. The communications apparatus 1600 isapplied to a scenario in which a terminal device moves from a first ANnode to a second AN node. The first AN node is managed by a first AMFnode, and the second AN node is managed by a second AMF node. Theapparatus 1600 may be the second AMF node or be inside the second AMFnode. For example, the apparatus 1600 may be configured to perform anaction of the second AMF node in the embodiment shown in FIG. 6. Theapparatus 1600 may include a sending unit 1601 and a receiving unit1602.

The sending unit 1601 is configured to send a first request message tothe first AMF node. The first request message is used to request amobility management context of the terminal device, and the firstrequest message carries identification information of a to-be-activatedsession of the terminal device.

The receiving unit 1602 is configured to receive a first responsemessage from the first AMF node. The first response message carries themobility management context of the terminal device.

Optionally, the first response message further carries identificationinformation of an active session of the terminal device, and theapparatus 1600 further includes: a processing unit 1603, configured to:when the to-be-activated session and the active session have a samesession, send, using the sending unit 1601, a second request message toan SMF node corresponding to the same session.

The second request message is used to request to activate the samesession; or the second request message is used to request to activatethe same session, the second request message carries deletion indicationinformation, and the deletion indication information is used to indicateto delete (R)AN tunnel information of the same session; or the secondrequest message is used to request to first deactivate the same sessionand then reactivate the same session.

Optionally, the first response message further carries identificationinformation of a same session, the same session is a same sessionbetween the to-be-activated session and the active session of theterminal device, and the sending unit 1601 is further configured to senda second request message to an SMF node corresponding to the samesession.

The second request message is used to request to activate the samesession; or the second request message is used to request to activatethe same session, the second request message carries deletion indicationinformation, and the deletion indication information is used to indicateto delete (R)AN tunnel information of the same session; or the secondrequest message is used to request to first deactivate the same sessionand then reactivate the same session.

As shown in FIG. 17, a sixteenth embodiment of this application providesa communications apparatus 1700. The communications apparatus 1700 isapplied to a scenario in which a terminal device moves from a first ANnode to a second AN node. The first AN node is managed by a first AMFnode, and the second AN node is managed by a second AMF node. Theapparatus 1700 may be the first AMF node or be inside the first AMFnode. For example, the apparatus 1700 may be configured to perform anaction of the first AMF node in the embodiment shown in FIG. 7. Theapparatus 1700 includes a transceiver unit 1701 and a processing unit1702.

The transceiver unit 1701 is configured to receive a first requestmessage from the second AMF node. The first request message is used torequest a mobility management context of the terminal device, and thefirst request message carries identification information of ato-be-activated session of the terminal device.

The transceiver unit 1701 is further configured to send a first responsemessage to the second AMF node. The first response message carries themobility management context of the terminal device.

The processing unit 1702 is configured to send a context release commandto the first AN node using the transceiver unit 1701 when a signalingconnection of the terminal device exists between the first AMF node andthe first AN node. The context release command is used to instruct torelease a context of the terminal device.

The transceiver unit 1701 is further configured to receive a contextrelease complete message from the first AN node. The context releasecomplete message carries identification information of an active sessionof the terminal device.

The processing unit 1702 is further configured to: when theto-be-activated session and the active session have a same session, skipsending a second request message to an SMF node corresponding to thesame session. The second request message is used to request todeactivate the same session.

Optionally, the processing unit 1702 is further configured to: when theto-be-activated session and the active session have a different session,send, using the transceiver unit 1701, a third request message to an SMFnode corresponding to a session that is in the active session but not inthe to-be-activated session, where the third request message is used torequest to deactivate the session that is in the active session but notin the to-be-activated session.

As shown in FIG. 18, a seventeenth embodiment of this applicationprovides a communications apparatus 1800. The apparatus 1800 may be anSMF node or a chip or a system-on-a-chip in the SMF node. The apparatus1800 may be configured to perform an action of the SMF node in theforegoing method embodiments. The apparatus 1800 includes a transceiverunit 1801 and a processing unit 1802.

The transceiver unit 1801 is configured to receive a request messagefrom an AMF node. The request message is used to request to activate asession, and the request message carries deletion indicationinformation. The deletion indication information is used to indicate todelete (R)AN tunnel information of the session.

The processing unit 1802 is configured to delete the (R)AN tunnelinformation of the session according to the deletion indicationinformation.

The transceiver unit 1801 is further configured to send a responsemessage to the AMF node. The response message carries core networktunnel information of the session.

As shown in FIG. 19, an eighteenth embodiment of this applicationprovides a communications apparatus 1900. The apparatus 1900 may be anSMF node or a chip or a system-on-a-chip in the SMF node. The apparatus1900 may be configured to perform an action of the SMF node in theforegoing method embodiments. The apparatus 1900 includes a transceiverunit 1901 and a processing unit 1902.

The transceiver unit 1901 is configured to receive a request messagefrom an AMF node. The request message is used to request to firstdeactivate a session and then reactivate the session.

The processing unit 1902 is configured to delete (R)AN tunnelinformation of the session based on the request message.

The transceiver unit 1901 is further configured to send a responsemessage to the AMF node. The response message carries core networktunnel information of the session.

As shown in FIG. 20, a nineteenth embodiment of this applicationprovides a communications apparatus 2000. The apparatus 2000 may be anSMF node or a chip or a system-on-a-chip in the SMF node. The apparatus2000 may be configured to perform an action of the SMF node in theforegoing method embodiments. The apparatus 2000 includes a transceiverunit 2001 and a processing unit 2002.

The transceiver unit 2001 is configured to receive a request messagefrom an AMF node. The request message is used to request to activate asession.

The processing unit 2002 is configured to delete (R)AN tunnelinformation of the session when the session is in an active state.

Optionally, the transceiver unit 2001 is further configured to send corenetwork tunnel information of the session to the AMF node.

It should be noted that the units mentioned in the foregoing apparatusembodiments may be implemented in a form of hardware. For example, thetransceiver unit may be a transceiver or a communications interface, theprocessing unit may be a processor, and both the receiving unit and thesending unit may be a communications interface or a transceiver. Theunits may be alternatively implemented in a form of a software functionmodule.

As shown in FIG. 21, a twentieth embodiment of this application providesa schematic diagram of a communications apparatus 2100. The apparatus2100 includes at least one processor 2101 and a memory 2102, and mayfurther include a communications bus 2103 and at least onecommunications interface 2104. The apparatus 2100 may be any device inthe embodiments of this application, and the apparatus 2100 may beconfigured to perform the methods provided in the embodiments of thisapplication.

The processor 2101 may be a general-purpose central processing unit(CPU), a microprocessor, an application-specific integrated circuit(ASIC), or one or more integrated circuits for controlling programexecution in solutions in this application.

The memory 2102 may be a read-only memory (ROM) or another type ofstatic storage device capable of storing static information andinstructions, or a random access memory (RAM) or another type of dynamicstorage device capable of storing information and instructions; or maybe an electrically erasable programmable read-only memory (EEPROM), acompact disc read-only memory (CD-ROM) or another compact disc storage,an optical disc storage (including a compressed optical disc, a laserdisc, an optical disc, a digital versatile disc, a Blu-ray disc, and thelike), a magnetic disk storage medium or another magnetic storagedevice, or any other medium capable of carrying or storing expectedprogram code in a form of an instruction or a data structure and capableof being accessed by the apparatus 2100. However, the memory 2102 is notlimited thereto. The memory may exist independently, and is connected tothe processor using the bus 2103. Alternatively, the memory may beintegrated with the processor.

The communications bus 2103 may include a channel for transferringinformation between the foregoing components.

The communications interface 2104 may be any apparatus like atransceiver, and is configured to communicate with another device orcommunications network, such as an Ethernet network, a RAN, or a WLAN.

The memory 2102 is configured to store program code, and the processor2101 is configured to execute the program code stored in the memory2102.

For example, the processor 2101 may include one or more CPUs such as aCPU 0 and a CPU 1 in FIG. 21.

For example, the apparatus 2100 may include a plurality of processorssuch as the processor 2101 and a processor 2105 in FIG. 21. Each of theprocessors may be a single-core (single-CPU) processor, or may be amulti-core (multi-CPU) processor. Herein, the processor may be one ormore devices, a circuit, and/or a processing core used to process data(such as a computer program instruction).

For example, the apparatus 2100 shown in FIG. 21 may be a prioritymanagement device or a part of the priority management device, and oneor more software modules are stored in the memory of the apparatus shownin FIG. 21. The apparatus 2100 shown in FIG. 21 may implement, byexecuting the program code in the memory using the processor, stepsperformed by the AMF node, the first AMF node, or the second AMF node ineach embodiment of this application.

For example, the apparatus shown in FIG. 21 may be a service server or apart of the service server, and one or more software modules are storedin the memory of the apparatus shown in FIG. 21. The apparatus shown inFIG. 21 may implement, by executing the program code in the memory usingthe processor, steps performed by the SMF node in each embodiment ofthis application.

An embodiment of this application further provides a computer storagemedium storing program code. When the program code is executed by aprocessor, the program code may be used to perform a step of a prioritymanagement device in each method embodiment.

An embodiment of this application further provides a computer storagemedium storing program code. When the program code is executed by aprocessor, the program code may be used to perform a step of a serviceserver (for example, a first service server or a second service server)in each method embodiment.

An embodiment of this application further provides a computer storagemedium storing program code. When the program code is executed by aprocessor, the program code may be used to perform a step of a client ineach method embodiment.

An embodiment of this application further provides a communicationssystem. The communications system includes the communicationsapparatuses shown in FIG. 12 and FIG. 20, or includes the communicationsapparatuses shown in FIG. 20 and FIG. 13, or includes any communicationsapparatus shown in FIG. 18 to FIG. 20 and the communications apparatusesshown in FIG. 15 and FIG. 16, or includes the communications apparatusesshown in FIG. 17 and FIG. 20.

All or some of the foregoing embodiments may be implemented usingsoftware, hardware, firmware, or any combination thereof. When softwareis used to implement the embodiments, the embodiments may be implementedcompletely or partially in a form of a computer program product. Thecomputer program product includes one or more computer instructions.When the computer program instructions are loaded and executed on acomputer, the procedure or functions according to the embodiments ofthis application are all or partially generated. The computer may be ageneral-purpose computer, a dedicated computer, a computer network, oranother programmable apparatus. The computer instructions may be storedin a computer-readable storage medium or may be transmitted from acomputer-readable storage medium to another computer-readable storagemedium. For example, the computer instructions may be transmitted from awebsite, computer, server, or data center to another website, computer,server, or data center in a wired (for example, a coaxial cable, anoptical fiber, or a digital subscriber line (DSL)) or wireless (forexample, infrared, radio, or microwave) manner. The computer-readablestorage medium may be any usable medium accessible by a computer, or adata storage device integrating one or more usable media, such as aserver or a data center. The usable medium may be a magnetic medium (forexample, a floppy disk, a hard disk, or a magnetic tape), an opticalmedium (for example, DVD), a semiconductor medium (for example, asolid-state drive (SSD)), or the like.

What is claimed is:
 1. A communication method, comprising: receiving, bya session management function node, a request message from an accesscontrol and mobility management function node, wherein the requestmessage requests activation of a session; determining, by the sessionmanagement function node before activating the session based on therequest message, whether the session is in an active state; anddeleting, in response to the session being in the active state, (radio)access network ((R)AN) tunnel information of the session.
 2. Thecommunication method of claim 1, wherein the request message is anupdate session management context request message.
 3. The communicationmethod of claim 2, wherein the update session management context requestmessage carries activation indication information indicating that theupdate session management context request message requests to activatethe session.
 4. The communication method of claim 1, wherein the requestmessage carries identification information of the session.
 5. Acommunications apparatus, comprising: a memory configured to storeinstructions; and a processor in communication with the memory andconfigured to execute the instructions to: receive a request messagefrom an access control and mobility management function node, whereinthe request message requests activation of a session; determine, beforeactivating the session based on the request message, whether the sessionis in an active state; and delete, in response to the session being inthe active state, (radio) access network ((R)AN) tunnel information ofthe session.
 6. The communications apparatus of claim 5, wherein therequest message is an update session management context request message.7. The communications apparatus of claim 6, wherein the update sessionmanagement context request message carries activation indicationinformation indicating that the update session management contextrequest message requests to activate the session.
 8. The communicationsapparatus of claim 5, wherein the request message carries identificationinformation of the session.
 9. A communication method for a terminaldevice moving from a first access network (AN) node to a second AN node,the communication method comprising: receiving, by the second AN node,identification information of one or more to-be-activated sessions fromthe terminal device; sending, by the second AN node, the identificationinformation to an access and mobility management function node; sending,by the access and mobility management function node based on theidentification information, a first request message to a first sessionmanagement function node corresponding to the one or moreto-be-activated sessions, wherein the first request message requestsactivation of the one or more to-be-activated sessions; sending, by theaccess and mobility management function node, a context release commandto the first AN node when a signaling connection of the terminal deviceexists between the access and mobility management function node and thefirst AN node, wherein the context release command instructs release ofa context of the terminal device; receiving, by the access and mobilitymanagement function node, a context release complete message from thefirst AN node, wherein the context release complete message carriesidentification information of one or more active sessions of theterminal device; and sending, by the access and mobility managementfunction node in response to a first session being in the one or moreto-be-activated sessions but not in the one or more active sessions, afirst deactivation request message requesting deactivation of the firstsession to a second session management function node corresponding tothe first session.
 10. The communication method of claim 9, furthercomprising skipping, by the access and mobility management function nodein response to a second session being in both the one or moreto-be-activated sessions and the one or more active sessions, sending asecond deactivation request message requesting deactivation of thesecond session to a third session management function node correspondingto the second session.
 11. The communication method of claim 9, whereinthe first request message is an update session management contextrequest message.
 12. The communication method of claim 11, wherein theupdate session management context request message carries activationindication information indicating that the update session managementcontext request message requests to activate the one or moreto-be-activated sessions.
 13. The communication method of claim 9,wherein the first request message carries the identification informationof the one or more to-be-activated sessions.
 14. The communicationmethod of claim 9, wherein the identification information is carried ina service request message.
 15. The communication method of claim 9,further comprising: receiving, by the first session management functionnode, the first request message; and deleting, by the first sessionmanagement function node, (radio) access network ((R)AN) tunnelinformation of the one or more to-be-activated sessions in response tothe one or more to-be-activated sessions being in an active state. 16.The communication method of claim 15, wherein before deleting the (R)ANtunnel information, the communication method further comprisesdetermining, by the first session management function node, that the oneor more to-be-activated sessions are in the active state.
 17. Thecommunication method of claim 16, wherein the first session managementfunction node determines that the one or more to-be-activated sessionsare in the active state before activating the one or moreto-be-activated sessions based on the first request message.
 18. Anon-transitory computer-readable medium configured to store computerinstructions, that when executed by one or more processors, cause theone or more processors to: receive a request message from an accesscontrol and mobility management function node, wherein the requestmessage requests activation of a session; determine, before activatingthe session based on the request message, whether the session is in anactive state; and delete, in response to the session being in the activestate, (radio) access network ((R)AN) tunnel information of the session.19. The non-transitory computer-readable medium of claim 18, wherein therequest message is an update session management context request message.20. The non-transitory computer-readable medium of claim 19, wherein theupdate session management context request message carries activationindication information indicating that the update session managementcontext request message requests to activate the session.